//
//  XYSqlite3.h
//  项目二三方库使用
//
//  Created by rimi on 15/12/9.
//  Copyright © 2015年 xiaoyi. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <FMDB/FMDB.h>

@interface XYSqlite3 : NSObject

/*打开数据库*/
- (void)openDataBase;

/*关闭数据库*/
- (void)closeTheDataBase;

/*重新打开数据库*/
- (void)reloadTheDataBase;

/*创建一个表*/
- (void)creatTheTable:(NSString *)tableName;

/*插入数据*/
- (void)insertDataSourceToDBwithArray:(NSArray *)array
                            tableName:(NSString *)tableName;

/*更新数据*//*修改数据*//*若是要更改年月日则要调用两次，第二次修改date，与time的年月日一致*/
- (void)updateDataBaseWithTableName:(NSString *)tableName
                         changeItem:(NSString *)changeItem //要改变的项
                      changeContent:(NSString *)changeContent //改变的内容
                         changeName:(NSString *)changeName;

/*该表是否存在*/
- (BOOL)isTableOK:(NSString *)tableName;

/*查询整个表*/
- (NSMutableArray *)searchTheDataBaseWithtableName:(NSString *)tableName;

/*条件查询*/
- (NSMutableArray *)conditionSearchTheDataBaseWithTableName:(NSString *)tableName
                                     searchName:(NSString *)searchName;
/*日期查询*//*年月日*/
- (NSMutableArray *)conditionSearchTheDataBaseWithTableName:(NSString *)tableName
                                     searchDate:(NSString *)searchDate;
/*删除任务*/
- (void)deleteTheDataBaseWithTableName:(NSString *)tableName
                            deleteName:(NSString *)deleteName;

/*完成日期查询*/
- (NSMutableArray *)conditionSearchTheDataBaseWithTableName:(NSString *)tableName
                                           searchFinishDate:(NSString *)searchFinishDate;

@end
